Posix record locking is supported on nearly all unix - like platforms it s mandated by posix . 1 , it can lock portions of a file not just a whole file , and it can handle the difference between read locks and write locks 采用posix記錄鎖的理由有很多: posix記錄鎖在幾乎所有的類unix平臺上都獲得了支持(它得到了posix . 1的授權(quán)) ,它可以鎖定文件的一部分(而不是只會鎖定整個文件) ,而且它可以區(qū)別處理讀鎖和寫鎖的不同之處。